using IQIGame.Onigao.Framework;

namespace IQIGame.Onigao.GamePlay
{
    public abstract class TViewComponent : TComponent
    {
        protected TViewEntity _entity;

        public override void OnCreate(TEntity entity)
        {
            if (entity is TViewEntity viewEntity)
            {
                this._entity = viewEntity;
            }
            else
            {
                LogGame.LogError("该组件不支持非TViewEntity类型的entity。");
            }
        }

        public virtual void OnComponentEvent<T>(TComponentEvent eventType, T arg)
        {

        }
    }
}
